package com.esunrise.shop.common.models;

import lombok.Data;

@Data
public class RespVo<T> {
    private String code;
    private String msg;
    private T data;

    public RespVo() {
    }

    public RespVo(String code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }


    public static <T> RespVo<T> succ(T data){
        return new RespVo<>("200", "success", data);
    }

    public static <T> RespVo<T> err(String code,String errMsg){
        return new RespVo<>(code, errMsg, null);
    }

}
